#include <iostream>

#include <jsoncpp/json/json.h>

#include "./compile_run.hpp"

int main()
{
    //下面的工作,是我们充当客户端请求的json串,来看看能否代码正常运行
    std::string in_json;
    Json::Value in_value;

    in_value["code"] = R"(
#include <iostream>

int main()
{
    std::cout << "hello" << std::endl;
    return 0;
}
    )";

    in_value["input"] = "";
    in_value["cpu_limit"] = 5;
    in_value["mem_limit"] = 1024 * 30;

    Json::FastWriter writer;

    in_json = writer.write(in_value);

    std::cout << in_json << std::endl;

    //下面这个事服务器给客户端返回的json串
    std::string out_json;
    ns_compile_run::compile_run::start(in_json, &out_json);

    std::cout << out_json << std::endl;

    return 0;
}
